package com.cencat.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

/**
 * 角色权限关联DTO
 * @author cencat
 * @since 2024-01-01
 */
@Data
@Schema(description = "角色权限关联DTO")
public class RolePermissionDTO {

    /**
     * 角色ID
     */
    @NotNull(message = "角色ID不能为空")
    @Schema(description = "角色ID", example = "1")
    private Long roleId;

    /**
     * 权限ID列表
     */
    @NotEmpty(message = "权限ID列表不能为空")
    @Schema(description = "权限ID列表", example = "[1, 2, 3]")
    private List<Long> permissionIds;

    /**
     * 租户ID
     */
    @NotNull(message = "租户ID不能为空")
    @Schema(description = "租户ID", example = "1")
    private Long tenantId;

    /**
     * 操作类型：assign-分配，remove-移除，update-更新
     */
    @Schema(description = "操作类型", example = "assign", allowableValues = {"assign", "remove", "update"})
    private String operationType;

    /**
     * 备注
     */
    @Schema(description = "备注", example = "批量分配权限")
    private String remark;

    /**
     * 操作人ID
     */
    @Schema(description = "操作人ID", example = "1")
    private Long operatorId;
}